home *** CD-ROM | disk | FTP | other *** search
- README (man, whatis, 95/06/18)
- ------------------------------
-
- someone (stanb@netcom.com) had asked for a man(1) command for reading
- manpages. i am posting such a system which includes:
-
- man - read online manpages
- apropos - list relevant manpages on a given topic (same as "man -k word")
- whatis - give 1-line description of a command (same as "man -f word")
- whatisin - list information about what is in sections of the manual
- mkwhatis - tool to help build whatis database
-
- note that man does not have its own pager. man calls the pager and
- gives it a filename. what man does is find the file (in known places)
- and figures out what to run (pager, whatis, apropos, etc.). in this
- regard it is really pretty simple minded. the hard part is getting,
- organizing, formatting, and maintaining the manpages. for example, i
- have hundreds of manpages on my systems. the typical unix system might
- have over a thousand manpages.
-
- these programs function more or less the same as the unix (BSD) commands
- with some exceptions:
-
- - man does not invoke nroff. your manpages should be preformatted.
- - every unix flavor has its own way of doing man so some of the
- switches on these commands may not correspond with all unix
- (or posix) ways of dealing with this.
- - the whatis database itself is different than how unix does it.
- but it is similar, and no two unix systems do it the same
- anyway.
-
- as it stands, these programs assumes the following directory structure:
-
- c:\usr\man main location of manpages, whatis db, etc
- c:\usr\man\man[0-9lno] dirs containing *unformatted* manpages)
- c:\usr\man\cat[0-9lno] dirs containing *formatted* manpages)
- c:\usr\man\whatis._?_ whatis databases for each section (you
- have to build these based on your collection
- of manpages)
- c:\usr\man\whatisin.___ whatisin database
-
- man will ONLY look in the cat* directories, and does not format the manpages.
- you will need nroff for this (cawf, groff, etc). i also have an nroff
- that i wrote years ago that is PD. or you can format the manpages on a unix
- system and download them to your PC.
-
- everything is configurable, both in the source and via the environment.
- for example, the c:\usr\man path can be overridded with:
-
- - setting environment variable MANPATH
- - using the commandline switch "-M path" on each command
- - changing the executables with a binary editor (i have left
- space in the source for such patches)
- - changing the source and recompiling
-
- caveats:
-
- - i am providing this free, with no restrictions. it is 100% my
- code (does not contain any unix code).
- - i will not help in any way to fix anything or add new features.
- this system runs fine under both Unix and on my atari ST (with
- gcc) so it should port easily, though i have not tried it under
- DOS or with djgpp.
- - i will not reformat the source to correspond to someone's notion
- of style. this is my prefered style, after 10 years of C coding
- and 20 years of fortran coding. :-)
- - if you don't like it, either a) fix it yourself, or b) don't use
- it. it is free, after all.
-
- Install:
-
- - Unpack everything into separate directories (./man, ./whatis).
- - The files are all ascii (no binary files). there are no CF-LF
- (just LF) so if you need CR-LF, you have to fix this yourself.
- - go to each dir (./man and ./whatis) and look at the makefile.
- change (at least) the following for your particular setup:
-
- CC how to invoke compiler
- LD how to link .o files
- MANTOP main location to place manpages (install)
- MANDIR specific location for manpage source
- CATDIR specific location for formatted manpages
- BINDIR location to install executables (man,
- whatis, etc)
- DEFS in man, you should specify what you have
- available (eg, if you have ul(1) and want
- the -ul switch to function, define HAS_UL).
- you probably want to define MSDOS, __GNUC__,
- and possibly undefine unix.
-
- in general, check all the macros in upper case in the
- makefile. note that i could have used sed in the makefile
- to patch names in the program, but i don't know how good
- make is on the PC.
-
- - man invokes the PAGER and other programs via the system(3) call.
- on unix (and on my atari), system will search PATH for executables
- so you don't need a full path. if this is not the case with djgpp,
- then you will have to alter ./man/man.c to build a full path
- for executing PAGER, cat, ul, whatis, apropos, etc.
-
- - type:
-
- make all will build the executables
- make install will install the execs and manpages
- make clobber will clean up after the make all.
-
- you may also consider doing "make dirs" before make install
- when building man. this creates the directory structure.
-
- you should do man before whatis.
-
- - if successful, you should be all set. i have provided formatted
- manpages (man.1, whatis.1, whatis.5, apropos.1, whatisin.1) from
- the manpage sources (man.man, whatis.man, whatis.ma5, etc). these
- were piped through "ul -t dumb" to remove any bold/underline
- escape sequences. so the formatted manpages are pure ascii. if
- you have a PAGER that groks how to handle nroff bold, etc, then
- you may want to reformat the manpages.
-
- you should at a minimum build man. it will allow you to read manpages.
- if you are up for it, the whatis capability might be desirable. whatis
- contains a 1-line description of every manpage you have on your system.
- for more information, see the file ./whatis/whatis.5 and whatis.1.
-
- note: i have not included any manpages here other than those for these
- programs themselves. don't ask me for a manpage on ls(1).
-
-
-
- Environment:
-
- these programs recognize several environment variables:
-
- MANPAGER man if set, this pager is used by man. on my
- atari, i have a special pager that resets
- fonts, based on what -T does in nroff on
- my system. this gives me bold, etc.
- PAGER man if MANPAGER is not set, this pager is used.
- the default is less.
- MANPATH man, location of the manpages, top level. the
- whatis default is c:\usr\man. at the moment, MANPATH
- apropos is a single path, not a list.
- whatisin
-
- for more, grep the sources for "getenv" or read the manpages.
-
- note that man will invoke other programs as follows (using system(3)):
-
- man file PAGER
- man -k word apropos
- man -f name whatis
-
- you can also invoke apropos and whatis by themselves, of course.
-
- that's about all i have time for. have fun...
-
- -bill rosenkranz
- rosenkra@convex.com
-
-